package ducct.footprint.entity;

import java.io.Serializable;
import java.util.Date;

import android.database.Cursor;
import android.text.format.DateFormat;

public class MyFootprint implements Serializable {
	private static final long serialVersionUID = -4860877817096429915L;
	
	public String locationName;
	public String imagePath;
	public String note;
	public double lat;
	public double lng;
	public long timestamp;
	
	public MyFootprint() {}
	
	public MyFootprint(Cursor cursor) {
		locationName = cursor.getString(cursor.getColumnIndex("locationName"));
		imagePath = cursor.getString(cursor.getColumnIndex("imagePath"));
		note = cursor.getString(cursor.getColumnIndex("note"));
		lat = cursor.getDouble(cursor.getColumnIndex("lat"));
		lng = cursor.getDouble(cursor.getColumnIndex("lng"));
		timestamp = cursor.getLong(cursor.getColumnIndex("timestamp"));
	}
	
	public String getTime() {
		return (String) DateFormat.format("MMMM dd, yyyy kk:mm", new Date(timestamp));
	}
}

